package org.networking.tcp.oneToMany;

import java.net.ServerSocket;
import java.net.Socket;

public class Server {
	public static void main(String[] args) throws Exception {
		ServerSocket server = new ServerSocket(888);
		System.out.println("服务器启动"+server);
		while(true){
			Socket socket = server.accept();
			SocketHandler handler = new SocketHandler(socket);
			
			//创建一个线程
			Thread thread = new Thread(handler);
			thread.start();//启动线程
		}
	}
}
